package kr.hkit.powerjava.algorithm;

public class StackTest {

	public static void main(String[] args) {
		int size = 3;
		Stack stack = new Stack(size);
		
		stack.push("a");
		stack.push("b");
		stack.prnArr();
		System.out.println();
		
		for(int i = 0; i<3; i++){
			stack.pop();
			stack.prnArr();
		}
		System.out.println();
		
		for(int i = 97; i<size+97; i++){
			stack.push(String.format("%c", i));
			stack.prnArr();
		}
		
		System.out.println(stack);
		
		Item i1 = new Item("A");
		Item i2 = new Item("B");
		Item i3 = new Item("D");
		Item i4 = new Item("C");
		
		Stack2 s = new Stack2();
		s.prnStack();
		System.out.println();
		
		s.push(i1);
		s.push(i2);
		s.push(i3);
		s.prnStack();
		System.out.println();
		
		s.pop();
		s.pop();
		s.prnStack();
		System.out.println();
		
		s.pop();
		s.pop();
		s.prnStack();
		System.out.println();
		
		s.push(i4);
		s.prnStack();
		System.out.println();
	}
}
